<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.kms.model.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List<MGroup> listmgroup =(List<MGroup>)request.getAttribute("listmgroup");
String sysselect = request.getAttribute("sysselect")+"";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
   <title>MBean Inspector</title>
   <link rel="stylesheet" href="<%=basePath %>css/style_master.css" type="text/css">
   <meta http-equiv="cache-control" content="no-cache">
<script type="text/javascript">
function statuss(num){
	var boxes = document.getElementsByName("mgid");
	data =new Array();
    for (var i = 0; i < boxes.length; i++){
        if (boxes[i].checked)
        {
            data[i]=boxes[i].value;
        }
    }
    if(num!='sysinsert' && data.length==0){
    	//alert('Please select an option!');
    }else if(num!='sysinsert' && data.length!=1){
		//alert('Select an option only !');
	}
	document.getElementById("status1").value = num;
	var form = document.getElementById("thisform");
    form.submit();
}
</script>
</head>
<body>

<table width="100%">
   </table><table>
      <tbody><tr>
         <td><img src="<%=basePath %>img/logo02.gif" alt="JBoss" align="left" border="0"></td>
         <td valign="middle"><h1>System Parameters Setting View</h1></td>
      </tr><tr>
   </tr></tbody></table>
   <ul>
   <table>
      <tbody>
       <li>Introduction :</li>
      <tr>
         <td><b>This feature page, mainly for backup tbs database functions as a foundation parameters, including the database server connection parameters and the path to backup files and other information<b/></td>
      </tr>
   </tbody>
   </table>
</ul>
<table cellpadding="5">
   <tbody><tr>
      <td><a href="#">Refresh MBean View</a></td>
   </tr>
	</tbody>
</table>
<hr>
<h3>List of SystemParameterBean attributes:</h3>

<form id="thisform" method="post" action="systemsetting">
<div >
<input id="status1" name="status1" type="hidden" />
<input value="Insert" type="button" onclick="javascript:statuss('sysinsert');"/>
<input value="Update" type="button" onclick="javascript:statuss('sysupdate');"/>
<input value="Delete" type="button" onclick="javascript:statuss('sysdelete');"/>
<input value="Select" type="button" onclick="javascript:statuss('sysselect');"/>
</div>
<br>
<table border="1" cellpadding="1" cellspacing="1">
  <tr class="AttributesHeader">
    <th>ID</th>
    <th>MonitorGroup</th>
    <th>Type</th>
    <th>OS IP</th>
    <th>OS PORT</th>
    <th>OS USER</th>
    <th>OS PWD</th>
  </tr>
<%
MSyspara msapp=new  MSyspara();
MSyspara msdb = new MSyspara() ;
for(int i=0;i<listmgroup.size();i++){
	MGroup mg = listmgroup.get(i);
	String styp="";
	for(MSyspara ms:mg.getListsyspara()){
		if("APP".equals(ms.getDatatype())){
			msapp = ms;
		}else{
			msdb = ms;
		}	
	}
	
	if(i%2==0){
		styp = "#AFAFAF";
	}
	%>
	
	  <tr>
	    <td height="63" rowspan="2" bgcolor="<%=styp %>"><input type="checkbox" id="mgid" name="mgid" value="<%=mg.getId() %>"/></td>
		<td rowspan="2" align="center" bgcolor="<%=styp %>"><strong><%=mg.getName() %></strong></td>
		<td bgcolor="<%=styp %>"><%=msapp.getDatatype() %></td>
		<td bgcolor="<%=styp %>"><%=msapp.getOsip() %></td>
		<td bgcolor="<%=styp %>"><%=msapp.getOsport() %></td>
		<td bgcolor="<%=styp %>"><%=msapp.getOsuser() %></td>
		<td bgcolor="<%=styp %>"><%=msapp.getOspwd() %></td>
	  </tr>
	  <tr>
		<td bgcolor="<%=styp %>"><%=msdb.getDatatype() %></td>
		<td bgcolor="<%=styp %>"><%=msdb.getOsip() %></td>
		<td bgcolor="<%=styp %>"><%=msdb.getOsport() %></td>
		<td bgcolor="<%=styp %>"><%=msdb.getOsuser() %></td>
		<td bgcolor="<%=styp %>"><%=msdb.getOspwd() %></td>
	  </tr>
		<%
		}
		%>
</tbody>
<tbody>
</tbody>
<tbody>
</tbody>
<tbody>
</tbody>
</table>
<input value="Apply Changes" type="submit" />
</form>
</body>
</html>
